Bicubic interpolation on the square consisting of 25 unit squares patched together. Bicubic interpolation as per Matplotlib's implementation. Colour indicates function value. The black dots are the locations of the prescribed data being interpolated. Note how the color samples are not radially symmetric.Bilinear interpolation on the same dataset as above. Derivatives of the surface are not continuous over the square boundaries.Nearest-neighbor interpolation on the same dataset as above.
双三次插值通过下式进行计算:
或者用展开的形式,
计算系数 的过程依赖于插值数据的特性。如果已知插值函数的导数,常用的方法就是使用四个顶点的高度以及每个顶点的三个导数。一阶导数 与 表示 x 与 y 方向的表面斜率,二阶相互导数 表示同时在 x 与 y 方向的斜率。这些值可以通过分别连续对 x 与 y 向量取微分得到。对于网格单元的每个顶点,将局部坐标(0,0, 1,0, 0,1 和 1,1) 带入这些方程,再解这 16 个方程。